package org.ushio.nchu_22201402.mapper;

import org.apache.ibatis.annotations.*;
import org.ushio.common_module.entity.UserBanTime;

import java.util.List;

@Mapper
public interface Admin_UserMapper {
    @Insert("insert into user_bantime (Phone_Number, Ban_Time, Ban_Reason) values(#{Phone_Number},#{Ban_Time},#{Ban_Reason})")
    public boolean Ban_Record(@Param("Phone_Number")String Phone_Number,@Param("Ban_Time")String Ban_Time,@Param("Ban_Reason")String Ban_Reason);

    @Update("update users set Ban_Status = 1 where Phone_Number = #{Phone_Number}")
    void Ban_User(@Param("Phone_Number")String Phone_Number);

    @Select("select * from user_bantime")
    List<UserBanTime> ListUserBan();

    @Select("select * from user_bantime where Phone_Number = #{Phone_Number}")
    List<UserBanTime> getBanIfo(@Param("Phone_Number")String Phone_Number);

    @Update("update users set Ban_Status = 0 where Phone_Number = #{Phone_Number}")
    void releaseUser(@Param("Phone_Number")String Phone_Number);
}



